IMG_VERSION ?= arm64v1
IMG_NAME ?= registry.cn-shanghai.aliyuncs.com/carl-zyc/latency-publisher:$(IMG_VERSION)

.PHONY: gen-proto
gen-proto:
	protoc --proto_path=api/pb --go-grpc_out=. --go_out=. api/pb/*.proto

.PHONY: clear-proto
clear-proto:
	rm -rf api/pb/*.go

.PHONY: docker-build
docker-build:
	docker build -t $(IMG_NAME) .

.PHONY: deploy
deploy:
	kubectl apply -f deploy/deploy.yaml

.PHONY: undeploy
undeploy:
	kubectl delete -f deploy/deploy.yaml

helm-install-prod:
	helm install latency-publisher ./charts/latency-publisher -f ./charts/latency-publisher/values-prod.yaml

helm-install-dev:
	helm install latency-publisher ./charts/latency-publisher -f ./charts/latency-publisher/values-dev.yaml

helm-uninstall:
	helm uninstall latency-publisher